from django.shortcuts import render

from . import ana

# Create your views here.

REMOTE_HOST = "https://pyecharts.github.io/assets/js"

def index(request):

    chipo = ana.ChipotleNan()

    info = chipo.how_many_are_sold_per_item()

    bar = chipo.bar(info.index, info.quantity)

    context = dict(
        
        myechart=bar.render_embed(),
        
        host=REMOTE_HOST,
        
        script_list=bar.get_js_dependencies()
        )

    return render(request, 'c2/index.html', context)
